<?php /* Smarty version Smarty-3.1.12, created on 2013-05-11 20:55:26
         compiled from "D:\wamp\www\acps_new\templates\reports\monthly_timesheet_reports.tpl" */ ?>
<?php /*%%SmartyHeaderCode:8535515053125f6465-21484019%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'ea5df709eccf23eab7faec459c58ea3fbf1593d7' => 
    array (
      0 => 'D:\\wamp\\www\\acps_new\\templates\\reports\\monthly_timesheet_reports.tpl',
      1 => 1368305718,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '8535515053125f6465-21484019',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_515053125f7c64_82445336',
  'variables' => 
  array (
    'data' => 0,
    'client' => 0,
    'period' => 0,
    'name' => 0,
    'recs' => 0,
    'record' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_515053125f7c64_82445336')) {function content_515053125f7c64_82445336($_smarty_tpl) {?><script type="text/javascript">
    
    
    function sendAction(action){
        $("#action").val(action);
        $("#submitting").submit();    
    }    
        
    $(document).ready(function() {
        $("#from").datepicker({ 
            dateFormat: "dd/mm/yy",
            firstDay: 1      
        });
        $("#to").datepicker({ 
            dateFormat: "dd/mm/yy",
            firstDay: 1      
        });
    });
    
</script>

<h2 class="pageTitle">Monthly timesheet reports</h2>

<div class="menu-list">
    <form action="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=monthly_timesheet_reports" method="post" id="submitting">
        <input type="hidden" name="goods" value="0" /><input type="checkbox" name="goods" value="1" <?php if ($_REQUEST['goods']==1){?>checked="checked"<?php }?> />Dodaný tovar&nbsp;
        <input type="hidden" name="servis" value="0" /><input type="checkbox" name="servis" value="1" <?php if ($_REQUEST['servis']==1){?>checked="checked"<?php }?> />Pravidelný servis&nbsp;
        <input type="hidden" name="other" value="0" /><input type="checkbox" name="other" value="1" <?php if ($_REQUEST['other']==1){?>checked="checked"<?php }?> />Služby mimo zmluvný rozsah&nbsp;<br/>
        Client: &nbsp;
        <select size="1" name="selectedClient">
            <option value="">Please select</option>
            <?php  $_smarty_tpl->tpl_vars["client"] = new Smarty_Variable; $_smarty_tpl->tpl_vars["client"]->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['data']->value['clients']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars["client"]->key => $_smarty_tpl->tpl_vars["client"]->value){
$_smarty_tpl->tpl_vars["client"]->_loop = true;
?>
                <option <?php if ($_SESSION['user']['user_type_id']!=@USER_TYPE_CLIENT&&$_smarty_tpl->tpl_vars['client']->value['bad_payer']==1){?>style="background: #ff545e"<?php }?> <?php if ($_smarty_tpl->tpl_vars['data']->value['prefill']['client']==$_smarty_tpl->tpl_vars['client']->value['klient_id']){?>selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['client']->value['klient_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['client']->value['name'];?>
</option>
            <?php } ?>
        </select>&nbsp;
        Period:
        <select size="1" name="selectedPeriod">
            <?php  $_smarty_tpl->tpl_vars["period"] = new Smarty_Variable; $_smarty_tpl->tpl_vars["period"]->_loop = false;
 $_smarty_tpl->tpl_vars["i"] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['periods']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars["period"]->key => $_smarty_tpl->tpl_vars["period"]->value){
$_smarty_tpl->tpl_vars["period"]->_loop = true;
 $_smarty_tpl->tpl_vars["i"]->value = $_smarty_tpl->tpl_vars["period"]->key;
?>
                <option <?php if ($_smarty_tpl->tpl_vars['period']->value['period']==$_smarty_tpl->tpl_vars['data']->value['prefill']['today']){?>selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['period']->value['period'];?>
"><?php echo $_smarty_tpl->tpl_vars['period']->value['period'];?>
<?php if ($_smarty_tpl->tpl_vars['period']->value['locked']==1){?>*<?php }?></option>
            <?php } ?>
        </select>
        &nbsp;<b>or</b>&nbsp;from
        <input name="selectedFrom" value="<?php echo $_smarty_tpl->tpl_vars['data']->value['prefill']['from'];?>
" type="text"  id="from" />
        &nbsp;to&nbsp;
        <input name="selectedTo" value="<?php echo $_smarty_tpl->tpl_vars['data']->value['prefill']['to'];?>
" type="text"  id="to" /> (must be filled from and to)
        <input id="action" name="action" value="" type="hidden" />
        <input value="Show" type="button" onclick="sendAction('show')" />
        <input value="Lock / Unlock" type="button" onclick="sendAction('lock')" /> * locked
    </form>
</div>

<?php echo $_smarty_tpl->getSubTemplate ($_smarty_tpl->tpl_vars['data']->value['pathToError'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>


<?php if (count($_smarty_tpl->tpl_vars['data']->value['output'])==0){?> 
    No records.
<?php }else{ ?>
    <div style="margin: 1em;">
        <?php if (isset($_smarty_tpl->tpl_vars['data']->value['prefill']['from'])&&isset($_smarty_tpl->tpl_vars['data']->value['prefill']['from'])){?>
            <a target="_blank" href="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
print.php?input=monthly_timesheet_reports&amp;selectedFrom=<?php echo $_smarty_tpl->tpl_vars['data']->value['prefill']['from'];?>
&amp;selectedTo=<?php echo $_smarty_tpl->tpl_vars['data']->value['prefill']['to'];?>
&amp;action=show&amp;selectedClient=<?php echo $_smarty_tpl->tpl_vars['data']->value['prefill']['client'];?>
&amp;goods=<?php echo $_REQUEST['goods'];?>
&amp;servis=<?php echo $_REQUEST['servis'];?>
&amp;other=<?php echo $_REQUEST['other'];?>
" class="basicButton">Print this report</a>
        <?php }else{ ?>
            <a target="_blank" href="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
print.php?input=monthly_timesheet_reports&amp;selectedPeriod=<?php echo $_smarty_tpl->tpl_vars['data']->value['prefill']['today'];?>
&amp;action=show&amp;selectedClient=<?php echo $_smarty_tpl->tpl_vars['data']->value['prefill']['client'];?>
&amp;goods=<?php echo $_REQUEST['goods'];?>
&amp;servis=<?php echo $_REQUEST['servis'];?>
&amp;other=<?php echo $_REQUEST['other'];?>
" class="basicButton">Print this report</a>
        <?php }?>
    </div>
    <?php  $_smarty_tpl->tpl_vars["client"] = new Smarty_Variable; $_smarty_tpl->tpl_vars["client"]->_loop = false;
 $_smarty_tpl->tpl_vars["client_id"] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['output']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars["client"]->key => $_smarty_tpl->tpl_vars["client"]->value){
$_smarty_tpl->tpl_vars["client"]->_loop = true;
 $_smarty_tpl->tpl_vars["client_id"]->value = $_smarty_tpl->tpl_vars["client"]->key;
?>
        <div style="margin: 0; padding: 0; page-break-after: always">
            <table class="protocol-list" style="font-size: 10px;">
                <tr>
                    <td colspan="2" style="vertical-align: top">
                        <h1 style="font-size: 14px; margin: 0px 0 5px 0; padding: 0">Príloha k faktúre:</h1>
                        <span style="font-size: 12px; margin: 0px; padding: 0; font-weight: bold">
                            Sumárny zoznam dodaných služieb a tovaru <br/>za obdobie 
                            <?php if (isset($_smarty_tpl->tpl_vars['data']->value['prefill']['from'])&&isset($_smarty_tpl->tpl_vars['data']->value['prefill']['from'])){?>
                                od <?php echo $_smarty_tpl->tpl_vars['data']->value['prefill']['from'];?>
 do <?php echo $_smarty_tpl->tpl_vars['data']->value['prefill']['to'];?>

                            <?php }else{ ?>
                                <?php echo $_smarty_tpl->tpl_vars['data']->value['prefill']['todayMonth'];?>
 <?php echo $_smarty_tpl->tpl_vars['data']->value['prefill']['todayYear'];?>

                            <?php }?><br/>
                            pre <?php echo $_smarty_tpl->tpl_vars['client']->value['client_info']['fullName'];?>
, IČO: <?php echo $_smarty_tpl->tpl_vars['client']->value['client_info']['ICO'];?>

                        </span>
                    </td>
                    <td colspan="3" style="vertical-align: top">
                        <h1 style="font-size: 14px; margin: 0px 0 5px 0; padding: 0">
                            Alfa Centauri spol. s r.o.
                        </h1>
                        <span style="font-size: 12px; margin: 0px; padding: 0">
                            Pri strelnici 3, 821 04 Bratislava<br/>
                            Web: Internet: www.alfac.sk <br/>
                            E-mail:  office@alfac.sk
                        </span>
                    </td>
                    <td colspan="2" style="vertical-align: top">
                        <h1 style="font-size: 14px; margin: 0px 0 5px 0; padding: 0">Kontaktná osoba:</h1>
                        <span style="font-size: 12px; margin: 0px; padding: 0">
                            <?php echo $_smarty_tpl->tpl_vars['client']->value['contact_info']['name'];?>
 <?php echo $_smarty_tpl->tpl_vars['client']->value['contact_info']['surname'];?>
<br/>
                            Email: <?php echo $_smarty_tpl->tpl_vars['client']->value['contact_info']['email'];?>

                        </span>
                    </td>
                    <td colspan="2" style="vertical-align: top">
                        <img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/alfac_no_text.png" width="120" />
                    </td>
                </tr>
                <tr>
                    <th colspan="9">
                        <br/>
                    </th>
                </tr>
                <?php  $_smarty_tpl->tpl_vars["recs"] = new Smarty_Variable; $_smarty_tpl->tpl_vars["recs"]->_loop = false;
 $_smarty_tpl->tpl_vars["name"] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['client']->value['types']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars["recs"]->key => $_smarty_tpl->tpl_vars["recs"]->value){
$_smarty_tpl->tpl_vars["recs"]->_loop = true;
 $_smarty_tpl->tpl_vars["name"]->value = $_smarty_tpl->tpl_vars["recs"]->key;
?>
                    <tr>
                        <td style="padding: 10px 0" colspan="9" class="left-align"><strong><?php echo $_smarty_tpl->tpl_vars['name']->value;?>
:</strong></td>
                    </tr>
                    <tr>
                        <td class="left-align" style="color:#0F192A; width: 300px; border-bottom: 1px solid gainsboro">Popis</td>
                        <td class="left-align" style="color:#0F192A; border-bottom: 1px solid gainsboro">Dátum</td>
                        <td class="left-align" style="color:#0F192A; border-bottom: 1px solid gainsboro">Sadzba</td>
                        <td class="left-align" style="color:#0F192A; border-bottom: 1px solid gainsboro">Množstvo</td>
                        <td class="left-align" style="color:#0F192A; border-bottom: 1px solid gainsboro">Jednotka</td>
                        <td class="left-align" style="color:#0F192A; border-bottom: 1px solid gainsboro">Jednotková cena</td>
                        <td class="left-align" style="color:#0F192A; border-bottom: 1px solid gainsboro">Cena bez DPH</td>
                        <td class="left-align" style="color:#0F192A; border-bottom: 1px solid gainsboro">Cena s DPH</td>
                        <td class="left-align" style="color:#0F192A; border-bottom: 1px solid gainsboro">Odovzdal</td>
                    </tr>
                    <?php  $_smarty_tpl->tpl_vars["record"] = new Smarty_Variable; $_smarty_tpl->tpl_vars["record"]->_loop = false;
 $_smarty_tpl->tpl_vars["k"] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['recs']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars["record"]->key => $_smarty_tpl->tpl_vars["record"]->value){
$_smarty_tpl->tpl_vars["record"]->_loop = true;
 $_smarty_tpl->tpl_vars["k"]->value = $_smarty_tpl->tpl_vars["record"]->key;
?>
                        <tr>
                            <td class="left-align" style="width: 300px;"><?php echo $_smarty_tpl->tpl_vars['record']->value['description'];?>
</td>
                            <td class="left-align"><?php echo $_smarty_tpl->tpl_vars['record']->value['date_formated'];?>
</td>
                            <td class="left-align"><?php echo $_smarty_tpl->tpl_vars['record']->value['tariff_info']['title'];?>
</td>
                            <td class="left-align"><?php echo $_smarty_tpl->tpl_vars['record']->value['amount'];?>
</td>
                            <td class="left-align"><?php echo $_smarty_tpl->tpl_vars['record']->value['tariff_info']['unit'];?>
</td>
                            <td class="left-align"><?php echo round($_smarty_tpl->tpl_vars['record']->value['unit_price'],"2");?>
 €</td>
                            <td class="left-align"><?php echo round($_smarty_tpl->tpl_vars['record']->value['withoutDph'],"2");?>
 €</td>
                            <td class="left-align"><?php echo round($_smarty_tpl->tpl_vars['record']->value['withDph'],"2");?>
 €</td>
                            <td class="left-align"><?php echo $_smarty_tpl->tpl_vars['record']->value['user_info']['name'];?>
 <?php echo $_smarty_tpl->tpl_vars['record']->value['user_info']['surname'];?>
</td>
                        </tr>
                    <?php } ?>
                    <tr>
                        <td colspan="3" class="left-align" style="border-top: 1px solid gray;color:#0F192A"><b>Suma - <?php echo $_smarty_tpl->tpl_vars['name']->value;?>
:</b></td>
                        <td class="left-align" style="border-top: 1px solid gray;color:#0F192A"><b><?php echo $_smarty_tpl->tpl_vars['client']->value['sums'][$_smarty_tpl->tpl_vars['name']->value]['totalAmount'];?>
</b></td>
                        <td class="left-align" style="border-top: 1px solid gray;color:#0F192A"></td>
                        <td class="left-align" style="border-top: 1px solid gray;color:#0F192A"></td>
                        <td class="left-align" style="border-top: 1px solid gray;color:#0F192A"><b><?php echo round($_smarty_tpl->tpl_vars['client']->value['sums'][$_smarty_tpl->tpl_vars['name']->value]['withoutDph'],"2");?>
 €</b></td>
                        <td class="left-align" style="border-top: 1px solid gray;color:#0F192A"><b><?php echo round($_smarty_tpl->tpl_vars['client']->value['sums'][$_smarty_tpl->tpl_vars['name']->value]['withDph'],"2");?>
 €</b></td>
                        <td class="left-align" style="border-top: 1px solid gray;color:#0F192A"></td>
                    </tr>
                <?php } ?>
                <tr>
                    <th colspan="9" class="left-align">
                        <br/>
                        <br/>
                    </th>
                </tr>
                <tr>
                    <td colspan="6" class="left-align" style="font-size: 12px; padding: 10px 0;"><b>Celková suma:</b></td>
                    <td class="left-align" style="font-size: 12px; padding: 10px 0; "><b><?php echo round($_smarty_tpl->tpl_vars['client']->value['total']['withoutDph'],"2");?>
 €</b></td>
                    <td class="left-align" style="font-size: 12px; padding: 10px 0; "><b><?php echo round($_smarty_tpl->tpl_vars['client']->value['total']['withDph'],"2");?>
  €</b></td>
                    <td class="left-align" style="font-size: 12px; padding: 10px 0; "></td>
                </tr>
                <tr>
                    <th colspan="9" class="left-align">
                        <br/>
                        <br/>
                    </th>
                </tr>
            </table>
        </div>
    <?php } ?>
<?php }?><?php }} ?>